//商品接口模块

//引入工具函数
import request from '@/utils/request'

//添加商品分类列表
export const goodsCatelist = params => {
    return request({
        method: 'get',
        url: '/goods/catelist',
        params,
    })
}

//确认修改分类
export const goodsEditcate = data => {
    return request({
        method: 'post',
        url: '/goods/editcate',
        data
    })
}

//删除商品
export const goodsDelcate = params => {
    return request({
        method: 'get',
        url: '/goods/delcate',
        params,
    })
}

//添加分类
export const goodsAddcate = data => {
    return request({
        method: 'post',
        url: '/goods/addcate',
        data,
    })
}

//添加商品
export const goodsAdd = data => {
    return request({
        method: 'post',
        url: '/goods/add',
        data,
    })
}

//查看所有商品分类
export const goodsCategories = () => {
    return request({
        method: 'get',
        url: '/goods/categories',
    })
}

//获取商品列表
export const goodsList = params => {
    return request({
        method: 'get',
        url: '/goods/list',
        params,
    })
}

//删除商品
export const goodsDel = params => {
    return request({
        method: 'get',
        url: '/goods/del',
        params
    })
}

//修改商品
export const goodsEdit=data=>{
    return request({
        method:'post',
        url:'/goods/edit',
        data
    })
}